#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n;
	cin >> n;
	int t = 0;
	map<int, int>mp;
	
	for(int i = 1; i <= n; i ++ ) {
		int x;
		cin >> x;
		if( mp[x] ) {
			t += (mp[x]);
			mp[x] ++ ;
		} else {
			mp[x] ++ ;
		}
		
		cout << t << " ";
	}
	return 0;
}

